﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using GameSchool.DAL;
using GameSchool.Models;

namespace GameSchool.Controllers
{
    public class StatsController : Controller
    {
        private IStatsRepository m_rep;

        public StatsController()
        {
            m_rep = new StatsRepository(new gsEntities());
        }

        public StatsController(IStatsRepository rep)
        {
            m_rep = rep;
        }

        [Authorize(Roles = "Nemandi")]
        public int GetStudentPointsBalance()
        {
            var studentUserId = (Guid)Membership.GetUser().ProviderUserKey;

            return m_rep.GetStudentPointsBalance(studentUserId);
        }
    }
}
